package com.eol.common.jwt;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: liulinhui
 * Date: 2018-11-26
 * Time: 15:03
 * Description:  TokenData
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("TOKEN基础信息")
public class TokenData {
    private static final long serialVersionUID = 2120869894112984147L;
    @ApiModelProperty(value = "用户ID")
    private String userId;

    @ApiModelProperty(value = "手机号码")
    private String phoneNum;

    @ApiModelProperty(value = "创建时间")
    private long t;

    @ApiModelProperty(value = "校验码")
    private long v;

    public TokenData(String userId, String phoneNum, long v) {
        this.userId = userId;
        this.phoneNum = phoneNum;
        this.t = new Date().getTime();
        this.v = v;
    }
}
